
package Scene;

import Util.Geometry;
import Util.Vertex;
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.media.opengl.GLJPanel;
import javax.swing.JFrame;

/**
 *
 * @author henriquediomede
 */
public class Main 
{
     public static void main(String[] args) 
     {
        Geometry v = new Geometry();
        
        Vertex v1 = new Vertex();
        Vertex v2 = new Vertex();
        Vertex v3 = new Vertex();
        Vertex v4 = new Vertex();
        
        Vertex vnormal = new Vertex();
        
        v1.x(0.0f);
        v1.y(0.0f);
        v1.z(0.0f);
        
        v2.x(0.0f);
        v2.y(0.0f);
        v2.z(1.0f);
       
        v3.x(1.0f);
        v3.y(0.0f);
        v3.z(0.0f);
        
        
        
      //  v.CalculateVectorNormal(v1, v2, v3, vnormal);
        //v.CalculateVectorNormal(v1, v3, v2, vnormal);
        v.calculateNormal(v2, v1, v3, vnormal);
 //v.CalculateVectorNormal(v2, v3, v1, vnormal);
       //v.CalculateVectorNormal(v3, v1, v2, vnormal);
//        v.CalculateVectorNormal(v3, v2, v1, vnormal);

        Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
        
        JFrame frame = new JFrame("Simple JOGL Application");
        GLJPanel panel = new GLJPanel();
        InputControl InputListener = new InputControl();
        LandScape game = new LandScape(dim.width,dim.height,panel);
        panel.addGLEventListener(game);
        frame.add(panel);
        frame.addKeyListener(InputListener);
        frame.addMouseMotionListener(InputListener);
        frame.setSize(dim.width, dim.height);
        frame.setLocationRelativeTo(null);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
        Thread gameThread = new Thread(game);
        gameThread.start();
        
     }
}
